package com.cloudkinto.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 * @author hua
 * @since 2024-11-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_operate_bill_rule")
public class OperateBillRuleDo extends Model<OperateBillRuleDo> {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 计费变量
     */
    @TableField("bill_code")
    private Integer billCode;

    /**
     * 减免量
     */
    @TableField("relie_qty")
    private Integer relieQty;

    /**
     * 单位数量
     */
    @TableField("unit_qty")
    private Integer unitQty;

    /**
     * 单价
     */
    @TableField("unit_price")
    private Double unitPrice;

    /**
     * 基础费
     */
    @TableField("base_fee")
    private Double baseFee;

    /**
     * 最低收费
     */
    @TableField("lowest_fee")
    private Double lowestFee;

    /**
     * 最高收费
     */
    @TableField("highest_fee")
    private Double highestFee;

    /**
     * 是否进位 0 不进位 1进位 给单位数量进位用的
     */
    @TableField("unit_carry")
    private Integer unitCarry;

    /**
     * 操作费主表id
     */
    @TableField("operate_bill_id")
    private Long operateBillId;

    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @TableField("create_by")
    private Long createBy;

    @TableField("create_time")
    private Date createTime;

    @TableField("update_time")
    private Date updateTime;

    @TableField("update_by")
    private Long updateBy;

    @TableField("delete_time")
    private Date deleteTime;

    @TableField("delete_by")
    private Long deleteBy;

    public Integer getRelieQtyZ() {
        if (relieQty == null || relieQty <= 0) {
            return 0;
        }
        return relieQty;
    }



    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
